﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using Colorful.Control.Properties;
using Microsoft.Practices.Composite.Wpf.Commands;

namespace Colorful.Control
{
    public class ConfigureProxyViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private void RaisePropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged( this, new PropertyChangedEventArgs( name ) );
        }

        public ConfigureProxyViewModel()
        {
            ProxyAddress = Settings.Default.ProxyAddress;
        }

        private string proxyAddress;

        public string ProxyAddress
        {
            get { return proxyAddress; }
            set
            {
                proxyAddress = value;
                Settings.Default.ProxyAddress = value;
                Settings.Default.Save();
                RaisePropertyChanged( "ProxyAddress" );
            }
        }
    }
}
